package com.tnsw.noxnox;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.FrameLayout;

public class CustomFrameLayout extends FrameLayout {

	private Paint p = new Paint();
	
	public CustomFrameLayout(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
		this.setPaint();
	}
	
	public CustomFrameLayout(Context context, AttributeSet attrs) {
		super(context, attrs);
		this.setPaint();
	}
	
	public CustomFrameLayout(Context context) {
		super(context);
		this.setPaint();
	}
	
	@Override
	protected void onDraw(Canvas canvas) {
		//Log.d("CustomFrameLayout", "doDraw()");
		//super.onDraw(canvas);
		
		canvas.drawRect(50, 50, 300, 300, p);
		canvas.drawLine(0, 0, 200, 200, p);

	}
	
	private void setPaint() {
		
		Log.d("CustomFrameLayout", "setPaint()");
		this.setWillNotDraw(false);
		p.setColor(Color.BLUE);
		p.setStrokeWidth(10);
		p.setStyle(Paint.Style.STROKE);
	}

}
